<script setup>
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';

import Prism from 'prismjs';

VMdPreview.use(vuepressTheme, {
  Prism,
});

const props = defineProps({
  text: String,
})

</script>

<template>
    <div class="preview">
        <v-md-preview style="height: calc(100vh - 50px);" :text="props.text == null ? '' : props.text"></v-md-preview>
    </div>
</template>

<style scoped>
.preview:deep(.vuepress-markdown-body){
    background-color: transparent;
    color: var(--el-color-text-dark);
}
</style>